<div class="modal-header">
    <h3>
        Clone branch {{config.sourceBranch.name}} ({{config.sourceBranch.project.name}})
        <span class="fa fa-question-circle text-info ot-action" ng-click="help = !help" title="Displays help."></span>
    </h3>
</div>
<form name="thisForm" class="form-horizontal" ng-submit="submit(thisForm.$valid)" novalidate="novalidate">
    <div class="modal-body">
        <div class="col-md-12 alert alert-info" ng-if="help">
            <p>
                A new branch will be created in the same project and
                the configuration from the current branch will be copied into the new one.
            </p>

            <p>
                Configuration items to be copied are:
            </p>
            <ul>
                <li>Promotion levels and their properties</li>
                <li>Validation stamps and their properties</li>
                <li>Properties</li>
                <li>User build filters</li>
            </ul>
        </div>
        <div class="form-group"
             ng-class="{ 'has-error' : thisForm['name'].$invalid && !thisForm['name'].$pristine }">
            <label class="control-label col-md-3">Name</label>

            <div class="col-md-9">
                <input name="name" class="form-control" ng-model="data.name" required="required"/>
            </div>
        </div>
        <div class="col-md-12 alert alert-info" ng-if="help">
            <p>
                Note that properties and descriptions of all items can be adjusted during the cloning operation
                by using the <a target="_blank" href="http://regular-expressions.info">regular expressions</a>
                and replacement expressions.
            </p>
        </div>
        <ot-branch-replacements data="data"></ot-branch-replacements>
    </div>
    <div class="modal-footer">

        <div class="ot-alert-{{message.type}} alert-dismissable" ng-show="message">
            <span>{{message.content}}</span>
        </div>

        <button class="btn btn-primary" type="submit" ng-disabled="thisForm.$invalid">OK</button>
        <button class="btn btn-link" type="button" ng-click="cancel()">Cancel</button>
    </div>
</form>